package pres.liko.iot.bean;


import java.util.List;
import java.util.Map;

/**
 * <p>ResponseVO.java</p>
 *
 * @author yang.zhang3
 * @date 2015年11月20日
 */
public class ResponseVO<T> extends BaseVO {

    private static final long serialVersionUID = 134474305226738346L;
    //接口响应状态码
    private String repCode;
    //接口调用结果，true|false
    private boolean repSuccess;
    //接口调用成功信息
    private String successMsg;
    //接口调用失败信息
    private String errorMsg;
    //接口调用警告信息
    private String warningMsg;

    private T datas;

    public ResponseVO() {
    }

    public ResponseVO(boolean repSuccess, String repMsg) {
        this(null, repSuccess, repMsg);
    }

    public ResponseVO(String repCode, boolean repSuccess, String repMsg) {
        this.repCode = repCode;
        this.repSuccess = repSuccess;
        if (repSuccess) {
            this.successMsg = repMsg;
        } else {
            this.errorMsg = repMsg;
        }
    }

    public ResponseVO(String repCode, boolean repSuccess,
                      String successMsg, String errorMsg, String warningMsg,
                      List<Map<String, Object>> mapList) {
        super();
        this.repCode = repCode;
        this.repSuccess = repSuccess;
        this.successMsg = successMsg;
        this.errorMsg = errorMsg;
        this.warningMsg = warningMsg;
    }

    public String getRepCode() {
        return repCode;
    }

    public void setRepCode(String repCode) {
        this.repCode = repCode;
    }

    public boolean isRepSuccess() {
        return repSuccess;
    }

    public void setRepSuccess(boolean repSuccess) {
        this.repSuccess = repSuccess;
    }

    public String getSuccessMsg() {
        return successMsg;
    }

    public void setSuccessMsg(String successMsg) {
        this.successMsg = successMsg;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getWarningMsg() {
        return warningMsg;
    }

    public void setWarningMsg(String warningMsg) {
        this.warningMsg = warningMsg;
    }

    public T getDatas() {
        return datas;
    }

    public void setDatas(T datas) {
        this.datas = datas;
    }

}
